/**
 * url跳转, 并对格式进行校验
 * @param url 
 */
export function toLink(url: string) {
  let fullUrl = ''
  if (url.includes('www.')) {
    if (url.startsWith('http://') || url.startsWith('https://')) {
      fullUrl = url
    } else {
      fullUrl = 'http://' + url
    }
  } else {
    fullUrl = url
  }  
  const a = document.createElement('a')
  a.href = fullUrl
  a.target = "_blank"
  a.click()
}